﻿namespace Tszy.Examples.Operators
{
    public static class OperatorExecutor
    {
        public static void Execute()
        {
            var obj1 = new OperatorModel(1);
            OperatorModel? obj2 = null;

            if (obj1)
            {
                Console.WriteLine($"obj1 is not null");
            }

            if (obj2)
            {
                Console.WriteLine($"obj1 is not null");
            }
            else
            {
                Console.WriteLine($"obj1 is null");
            }

            var result = obj1 == obj2;

            Console.WriteLine($"result1:{result}");

            obj2 = new OperatorModel(2);

            result = obj1 == obj2;

            Console.WriteLine($"result2:{result}");

            result = obj1 != obj2;

            Console.WriteLine($"result3:{result}");

            obj2 = new OperatorModel(1);

            result = obj1 == obj2;

            Console.WriteLine($"result4:{result}");
        }
    }
}